import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
from scipy.interpolate import make_interp_spline, BSpline

plt.rcParams['font.sans-serif']=['SimHei'] #用来正常显示中文标签
plt.rcParams['axes.unicode_minus']=False #用来正常显示负号

# 数据载入
filename = 'C:/Users/dell/Desktop/重点研发2.8/轮胎成型/成型数据/2-胶部件规格/部件规格_相关性分析.xlsx'  # replace with your file path
data = pd.read_excel(filename, usecols=[17])

#绘制光滑曲线
x = data.index
y = data.iloc[:, 0]
xnew = np.linspace(x.min(), x.max(), 500)
spl = make_interp_spline(x, y)
y_smooth = spl(xnew)

# Plot the curve
plt.figure(figsize=(10, 6))
plt.plot(xnew, y_smooth)
plt.title('胶条张力数据')
plt.xlabel('数据样本')
plt.ylabel('张力值/N')
plt.grid()
plt.show()